<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>嘉童游乐中心-商品定价清单</title>
<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<script type="text/javascript">
//保存定价信息
function saveHeadPrice(id){
	var isTrue=checkForm();
	if(!isTrue){
		return;
	}
	$("#status").val(id);
	$.ajax({
		url:"${basePath}scmInvocing/priceManager/reSetPriceForHead.shtml",
		data:$("#headPriceForm").serialize(),
		type:"post",
 		async:false,
 		dataType:"text",
 		error : function(XMLHttpRequest) {
				ajaxError(XMLHttpRequest);
			},
 		success:function(result){
 				if(result=="success"){
 					window.location.href="${basePath}scmInvocing/priceManager/forwardToList.shtml";
 				}
 		}
	});
}
function checkForm(){
	var headPrice=$("#headPrice").val();
	if(!checkIsDouble(headPrice)){
		alertWarning("总部价格不能为空!")
		return false;
	}
	var marketPrice=$("#marketPrice").val();
	if(!checkIsDouble(marketPrice)){
		alertWarning("市场价不能为空!");
		return false;
	}
	return true;
}
//验证价格
function  checkThePrice(thisObj){
	var  price=$(thisObj).val();
	if(!checkIsNull(price)){
		if(!checkIsDouble(price)){
			alertWarning("请输入正确的价格!");
			$(thisObj).val("");
		}
	}
}
</script>
</head>
<body class="bg">
<div class="content m_auto">
 <div class="content_l mt10">
    	<ul>
    		<shiro:hasPermission name="scmInvocing/productInfo/forwardToProductInfo.shtml">
    				  <li ><a href="${basePath}scmInvocing/productInfo/forwardToProductInfo.shtml"><i class="nav_icon_b"></i><br>商品信息</a></li>
    		</shiro:hasPermission>
    		 <shiro:hasPermission name="scmInvocing/countUnit/forwardToUnitInfo.shtml">
    		 		<li><a href="${basePath}scmInvocing/countUnit/forwardToUnitInfo.shtml"><i class="nav_icon_b"></i><br>单位设置</a></li>
    		 </shiro:hasPermission>
    		 <shiro:hasPermission name="scmInvocing/supplier/forwardToSupply.shtml">
    		 		   <li><a href="${basePath}scmInvocing/supplier/forwardToSupply.shtml"><i class="nav_icon_a"></i><br>供应商信息</a></li>
    		 </shiro:hasPermission>
    		  <shiro:hasPermission name="scmInvocing/priceManager/forwardToList.shtml">
    		 		  <li  class="content_hover"><a href="${basePath}scmInvocing/priceManager/forwardToList.shtml"><i class="nav_icon_f"></i><br>价格管理</a></li>
    		 </shiro:hasPermission>
    		   <shiro:hasPermission name="scmInvocing/scmPurOrder/findInvoPurOrder.shtml">
            	  <li><a href="${basePath}scmInvocing/scmPurOrder/findInvoPurOrder.shtml"><i class="nav_icon_b"></i><br>采购订单</a></li>
    		 </shiro:hasPermission>
    		   <shiro:hasPermission name="scmInvocing/scmPayForm/findInvoOrderPay.shtml">
           		   <li><a href="${basePath}scmInvocing/scmPayForm/findInvoOrderPay.shtml"><i class="nav_icon_b"></i><br>付款申请</a></li>
    		 </shiro:hasPermission>
   		</ul>
    </div>
    <div class="content_r mt10">
    	<div class="p20">
    	<form id="headPriceForm">
    	<input type="hidden" name="status" id="status" value="" >
    	<input type="hidden" name="modiBy" value="${modiBy}" >
    	<input type="hidden" name="fkPrdId" value="${entity.pkPrdId}">
    	<input type="hidden" name="pkPriceId" value="${entity.pkPriceId}">
    	<div class="file_single_dl f14 fixed">
             <dl class="fixed"  >
                <dd ><label><h1>商品定价清单</h1></label></dd>
            </dl>
            <dl class="fixed"  >
                <dd><label>定价人：</label>${setName}</dd> <dd ><label>定价日期：</label>${setDate}</dd>
            </dl>
       		 <dl class="fixed"  >
                <dd ><label>商品编号：</label> <input type="text" class="iput_t w200" value="${entity.pkPrdId}" disabled>  </dd> 
                <dd ><label>商品名称：</label> <input type="text" class="iput_t w200" value="${entity.prdName}" disabled>  </dd>
            </dl>
      		 <dl class="fixed"  >
                <dd ><label> 计量单位：</label> <input type="text" class="iput_t w200" value="${entity.unitName}" disabled>  </dd> 
                <dd ><label>商品规格：</label> <input type="text" class="iput_t w200" value="${entity.prdSpec}" disabled>  </dd>
            </dl>
    
             <dl class="fixed"  >
                <dd ><label> 商品分类：</label> <input type="text" class="iput_t w200" value="${entity.cateName}" disabled>  </dd> 
                <dd ><label>市场销售价：</label> <input type="text" class="iput_t w200" value="${entity.marketPrice }"    onblur="checkThePrice(this);"   name="marketPrice" id="marketPrice"> </dd>
            </dl>
              <dl class="fixed"  >
              <dd ><label> 允许分店定价：</label> <div class="uboxstyle">
                			<c:choose>
                					<c:when test="${entity.isAllow=='1'}">
                							  <select name="isAllow" id="isAllow" >
                                 					<option value="1" selected="selected">是</option> 
                                 					<option value="0">否</option> 
                            				 </select>	
                					</c:when>
                					<c:otherwise>
                						<select name="isAllow" id="isAllow" >
                                			 	<option value="1">是</option> 
                                 				<option value="0" selected="selected">否</option> 
                             			</select>
                					</c:otherwise>
                			</c:choose>
                         </div> </dd> 
            </dl>
            <dl class="fixed"   >
             <dd ><label>总部价格：</label> <input type="text" class="iput_t w200" value="${entity.headPrice}" name="headPrice" id="headPrice"  onblur="checkThePrice(this);"  >  </dd>
              
            </dl>
            <dl class="fixed"   >
             
              <dd><label>复核结果：</label>不同意</dd>
            </dl>
             <dl class="fixed"  >
              <dd><label>复核意见：</label><textarea class="textare w200"  name="auditRemark"  disabled>${entity.auditRemark}</textarea></dd>
            </dl>
        </div>
        </form>
            <!----底部按钮----->
            <div class="btm_btn mt10">
                     <dl>
 						       <dd><input class="btn" type="button" value="提交" onclick="saveHeadPrice('3');"></dd>
                        <dd><input class="btn" type="button" value="返回" onclick="javascript:window.location.href='${basePath}scmInvocing/priceManager/forwardToList.shtml' "></dd>
                    </dl>
            </div>
            <!----底部按钮----->
      
        </div>
    </div>
</div>

</body>
</html>
